package com.jingyanzi.sys.client.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.jingyanzi.sys.domain.MemberGradeDO;
import com.jingyanzi.sys.domain.result.ResultDO;
import com.jingyanzi.sys.domain.result.ResultSupport;
import com.jingyanzi.sys.domain.service.IMemberConfigService;

@RestController
@RequestMapping("/api")
public class MemberConfigClientImpl {

	@Autowired
	private IMemberConfigService memberConfigService;

	@RequestMapping("/right/{id}")
	public MemberGradeDO getMemberGradeDO(@PathVariable(value = "exp") Integer exp) {
		ResultDO res = memberConfigService.judgeLevel(exp);
		MemberGradeDO domain = (MemberGradeDO) res.getModel(ResultSupport.FIRST_MODEL_KEY);
		return domain;
	}
}
